package dao;

import util.DBHelper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ProductCategoyDao {
    public List<Map<String,Object>> queryimage(String tname,String proname){
        String sql = " select image,o.tname,proname from shopping_type o INNER JOIN shopping_product r ON o.tid=r.tid where 1=1  ";
        List<String> params = new ArrayList<>();
        if(tname.trim().isEmpty() == false && tname != null){
            sql += " and tname = ?";
            params.add( tname);
        }

        if(proname.trim().isEmpty() == false && proname != null){
            sql += " and proname = ?";
            params.add( proname);
        }
        return DBHelper.selectListMap(sql,params.toArray());
    }
}
